package com.twenty.seven.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author 001
 * @Date 2020/1/8 16:16
 * @TODO
 **/
@Entity
@Data
@Table(name = "user")
//@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) getOne()时添加不会报反序列化失败
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private long id;

    @Column(name = "name")
    private String name;

    @Column(name = "birthday")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @Column(name = "sex")
    private Integer sex;
}
